VERIFICATION_FAILED: 2,
VERIFICATION_SUCCEEDED: 3,
VERIFICATION_CANCELLED: 4,
+ VERIFICATION_IN_PROGRESS: 5,
};
var BeginRequestType = {
PROVIDE_USERNAME: 0,
DONT_PROVIDE_USERNAME: 1,
+ REUSE_USERNAME: 2,
};
var AuthPrompt = GObject.registerClass({
this._gdmClient = gdmClient;
this._mode = mode;
this._defaultButtonWellActor = null;
+ this._cancelledRetries = 0;
let reauthenticationOnly;
if (this._mode == AuthPromptMode.UNLOCK_ONLY)
}
_activateNext(shouldSpin) {
+ this.verificationStatus = AuthPromptStatus.VERIFICATION_IN_PROGRESS;
this.updateSensitivity(false);
if (shouldSpin)
// We don't need to know the username if the user preempted the login screen
// with a smartcard or with preauthenticated oVirt credentials
beginRequestType = BeginRequestType.DONT_PROVIDE_USERNAME;
+ } else if (oldStatus === AuthPromptStatus.VERIFICATION_IN_PROGRESS) {
+ // We're going back to retry with current user
+ beginRequestType = BeginRequestType.REUSE_USERNAME;
} else {
// In all other cases, we should get the username up front.
beginRequestType = BeginRequestType.PROVIDE_USERNAME;
if (this.verificationStatus == AuthPromptStatus.VERIFICATION_SUCCEEDED)
return;
- this.verificationStatus = AuthPromptStatus.VERIFICATION_CANCELLED;
+ if (this.verificationStatus === AuthPromptStatus.VERIFICATION_IN_PROGRESS) {
+ this._cancelledRetries++;
+ if (this._cancelledRetries > this._userVerifier.allowedFailures)
+ this.verificationStatus = AuthPromptStatus.VERIFICATION_FAILED;
+ } else {
+ this.verificationStatus = AuthPromptStatus.VERIFICATION_CANCELLED;
+ }
+
this.reset();
}
});
this._resetGreeterProxy();
this._sessionMenuButton.updateSensitivity(true);
+ const previousUser = this._user;
this._user = null;
if (this._nextSignalId) {
this._nextSignalId = 0;
}
- if (beginRequest == AuthPrompt.BeginRequestType.PROVIDE_USERNAME) {
+ if (previousUser && beginRequest === AuthPrompt.BeginRequestType.REUSE_USERNAME) {
+ this._user = previousUser;
+ this._authPrompt.setUser(this._user);
+ this._authPrompt.begin({ userName: previousUser.get_user_name() });
+ } else if (beginRequest === AuthPrompt.BeginRequestType.PROVIDE_USERNAME) {
if (!this._disableUserList)
this._showUserList();
else